/*
* @author : TF-BJ-C064
* @creation : 2014-8-6 下午8:50:40
* @description : 
*
*/

package com.umeng;

import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;

import org.apache.http.client.ClientProtocolException;
import org.apache.log4j.Logger;

public class UMmain {
	
	public Logger log = Logger.getLogger(UMmain.class);
	
	private static String USER_NAME = "app@teleframe.cn";
	private static String PASSWORD = "teleframe2014";

	private UMUser user = new UMUser(USER_NAME, PASSWORD);
	private UMLoginAction umLoginAction = new UMLoginAction();
	private UMStat stat = new UMStat();
	
	
	public void CrawlUMeng() throws ClientProtocolException, IOException, KeyManagementException, NoSuchAlgorithmException, SQLException{
	
		umLoginAction.setUser(user);
		stat.setUser(user);
		
		umLoginAction.index();
		log.info("=======================================================================");
		umLoginAction.login();
		log.info("=======================================================================");
		stat.apps();
		log.info("=======================================================================");
		stat.statActive();
		stat.Save2Datebase();
		
		log.info("done");
	}
	
	
 
	public static void main(String[] args) throws ClientProtocolException, IOException, KeyManagementException, NoSuchAlgorithmException, SQLException {
		(new UMmain()).CrawlUMeng();
	}

}
